import axios from "axios";

const request1 = axios.create({
  timeout: 5000
});

request1.interceptors.request.use(config => {
  const token = localStorage.getItem("token");
  if (token) {
    config.headers["token"] = token;
  }
  return config;
});

// 请求拦截器
request1.interceptors.response.use(
  config => {
    return config;
  },
  error => {
    console.log(error);
  }
);

export default request1;
